package com.treasure.mall.biz.dto.blacklist;

import com.treasure.mall.biz.dto.BaseSaveDTO;
import com.treasure.mall.zbq.common.ienum.SystemEnums;
import com.treasure.mall.zbq.common.ienum.base.CodeDescEnumHelper;
import lombok.Data;

/**
 * 
 * <p> 添加黑名单
 * +---------------------------------------------------------
 * * @package: com.treasure.mall.biz.dto.blacklist
 * * @author: guomw (guomwchen@foxmail.com)
 * * @date: 2020/9/23 2:39 下午
 * * @since: V1.0.0
 * +---------------------------------------------------------
 * 注意：本内容仅限于内部传阅，禁止外泄以及用于其他的商业目的
 * 
 */
@Data
public class BlacklistSaveDTO implements BaseSaveDTO {

    /**
     *
     */
    private String mobile;

    /**
     * 黑名单类型
     */
    private int type = 0;


    /**
     * 获取黑名单类型
     *
     * @return
     */
    public SystemEnums.BlacklistType getBlacklistType() {
        SystemEnums.BlacklistType blacklistType = CodeDescEnumHelper.getEnumTypeByCode(SystemEnums.BlacklistType.class, type);
        if (blacklistType == null) {
            blacklistType = SystemEnums.BlacklistType.LIVE_ROOM;
        }
        return blacklistType;
    }
}
